<?php
/**
 * Abstract base class for boolean sets of conditions like AND, OR and XOR.
 * @author dengdl
 *
 */
abstract class Workflow_Condition_BooleanSet implements Workflow_Condition
{
	/**
     * Array of WorkflowConditions
     *
     * @var array
     */
    protected $conditions;
    
	/**
     * Constructs a new boolean set with the conditions $conditions.
     *
     * The format of $conditions must be array( WorkflowCondition )
     *
     * @param array $conditions
     * @throws WorkflowDefinitionStorageException
     */
    public function __construct( array $conditions )
    {
        foreach ( $conditions as $condition )
        {
            if ( !$condition instanceof Workflow_Condition )
            {
                throw new Exception(
                  'Array does not contain (only) WorkflowCondition objects.'
                );
            }

            $this->conditions[] = $condition;
        }
    }

    /**
     * Returns the conditions in this boolean set.
     *
     * @return WorkflowCondition[]
     * @ignore
     */
    public function getConditions()
    {
        return $this->conditions;
    }
}
?>